package cn.edu.stu.syllabus.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * Created by daidaijie on 2016/7/22.
 * 单例子Gson类
 */
public class GsonUtils {
    private Gson mGson;

    private GsonUtils() {
        mGson = new GsonBuilder()
                .setPrettyPrinting()
                .enableComplexMapKeySerialization()
                .create();
    }


    public static Gson getInstance() {
        return GsonUtilsHolder.sGsonUtils.mGson;
    }

    private static class GsonUtilsHolder {
        public static GsonUtils sGsonUtils = new GsonUtils();
    }

}
